//
//  RootViewController.m
//  Today
//
//  Created by fanfan on 15/5/22.
//  Copyright (c) 2015年 fanfan. All rights reserved.
//

#import "RootViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];

    UIImageView *backimage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    backimage.backgroundColor = [UIColor yellowColor];
    backimage.image = [UIImage imageNamed:@"backimage.jpg"];
    backimage.contentMode = UIViewContentModeScaleAspectFill;
    [self.view addSubview:backimage];
    
    weatherButton = [UIButton buttonWithType:UIButtonTypeCustom];
    weatherButton.frame = CGRectMake(40, 40, 100, 100);
    [weatherButton setTitle:@"今日天气" forState:UIControlStateNormal];
    [weatherButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    weatherButton.backgroundColor = [UIColor clearColor];
    weatherButton.layer.cornerRadius = 50;
    weatherButton.layer.masksToBounds = YES;
    weatherButton.layer.borderWidth = 1.0;
    weatherButton.layer.borderColor = [UIColor yellowColor].CGColor;
    [weatherButton addTarget:self action:@selector(weather) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:weatherButton];
    
    NewsButton = [UIButton buttonWithType:UIButtonTypeCustom];
    NewsButton.frame = CGRectMake(240, 140, 100, 100);
    [NewsButton setTitle:@"今日新闻" forState:UIControlStateNormal];
    [NewsButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    NewsButton.backgroundColor = [UIColor clearColor];
    NewsButton.layer.cornerRadius = 50;
    NewsButton.layer.masksToBounds = YES;
    NewsButton.layer.borderWidth = 1.0;
    NewsButton.layer.borderColor = [UIColor yellowColor].CGColor;
    [NewsButton addTarget:self action:@selector(news) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:NewsButton];
    
    MoodButton = [UIButton buttonWithType:UIButtonTypeCustom];
    MoodButton.frame = CGRectMake(80, 240, 100, 100);
    [MoodButton setTitle:@"今日心情" forState:UIControlStateNormal];
    [MoodButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    MoodButton.backgroundColor = [UIColor clearColor];
    MoodButton.layer.cornerRadius = 50;
    MoodButton.layer.masksToBounds = YES;
    MoodButton.layer.borderWidth = 1.0;
    MoodButton.layer.borderColor = [UIColor yellowColor].CGColor;
    [MoodButton addTarget:self action:@selector(mood) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:MoodButton];
    
    Signature = [UIButton buttonWithType:UIButtonTypeCustom];
    Signature.frame = CGRectMake(140, 340, 100, 100);
    [Signature setTitle:@"今日签名" forState:UIControlStateNormal];
    [Signature setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    Signature.backgroundColor = [UIColor clearColor];
    Signature.layer.cornerRadius = 50;
    Signature.layer.masksToBounds = YES;
    Signature.layer.borderWidth = 1.0;
    Signature.layer.borderColor = [UIColor yellowColor].CGColor;
    [Signature addTarget:self action:@selector(signature) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:Signature];
    
    ConstellationButton = [UIButton buttonWithType:UIButtonTypeCustom];
    ConstellationButton.frame = CGRectMake(160, 500, 100, 100);
    [ConstellationButton setTitle:@"今日星座" forState:UIControlStateNormal];
    [ConstellationButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    ConstellationButton.backgroundColor = [UIColor clearColor];
    ConstellationButton.layer.cornerRadius = 50;
    ConstellationButton.layer.masksToBounds = YES;
    ConstellationButton.layer.borderWidth = 1.0;
    ConstellationButton.layer.borderColor = [UIColor yellowColor].CGColor;
    [ConstellationButton addTarget:self action:@selector(constellation) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:ConstellationButton];
 
}

- (void)weather{
    WeatherViewController *weather = [[WeatherViewController alloc] init];
    [self.navigationController pushViewController:weather animated:NO];
}
- (void)news{
    NewsViewController *news = [[NewsViewController alloc] init];
    [self.navigationController pushViewController:news animated:NO];
}
- (void)mood{
    MoodRootViewController *mood = [[MoodRootViewController alloc] init];
    [self.navigationController pushViewController:mood animated:NO];
}
- (void)signature{
    SignatureViewController *signature = [[SignatureViewController alloc] init];
    [self.navigationController pushViewController:signature animated:NO];
}
- (void)constellation{
    ConstellationViewController *constellation = [[ConstellationViewController alloc] init];
    [self.navigationController pushViewController:constellation animated:NO];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
